import React,{ useState,useMemo } from 'react'

function TestUserMemo() {
    const [count,setCount] = useState(0)
    const [num,setNum] = useState(0)

    let res = useMemo(() => {
        
        return {count,num}
    })

    return <div>
        测试memeo --- {res.count} --- {res.num}
        <button onClick={() => setCount(count + 1)}>更改count</button>&nbsp;
        <button onClick={() => setNum(num+1)}>更改num</button>
    </div>
}

export default TestUserMemo